package com.qyhl.webtv.module_microvideo.shortvideo.play;


import com.qyhl.webtv.basiclib.utils.StringUtils;
import com.qyhl.webtv.commonlib.entity.microvideo.ShortVideoBean;

import java.util.List;

public class ShortVideoPlayPresenter implements ShortVideoPlayContract.ShortVideoPlayPresenter {
    private ShortVideoPlayModel mModel;
    private ShortVideoPlayContract.ShortVideoPlayView mView;

    ShortVideoPlayPresenter(ShortVideoPlayContract.ShortVideoPlayView mView) {
        this.mView = mView;
        this.mModel = new ShortVideoPlayModel(this);
    }

    @Override
    public void getDetail(String workId, String phone) {
        mModel.getDetail(workId, phone);
    }

    @Override
    public void doPraise(String workId, String phone) {
        mModel.doPraise(workId, phone);
    }

    @Override
    public void getFollowNum(String workId) {
        mModel.getFollowNum(workId);
    }

    @Override
    public void setDetail(ShortVideoBean bean) {
        mView.setDetail(bean);
    }

    @Override
    public void setError(String msg) {
        mView.setError(msg);
    }

    @Override
    public void praiseSuccess() {
        mView.praiseSuccess();
    }

    @Override
    public void praiseError(String msg) {
        mView.praiseError(msg);
    }

    @Override
    public void getData(String actId, String page, int type) {
        mModel.getData(actId, page, type);
    }

    @Override
    public void setData(List<ShortVideoBean> beanList) {
        mView.setData(beanList);
    }

    @Override
    public void setDataError(String msg) {
        mView.setDataError(msg);
    }

    @Override
    public void setFollowNum(String followNum) {
        mView.setFollowNum(StringUtils.isEmpty(followNum)?"0":followNum);
    }
}
